<template>
	<view>
		<p-navbar title="收益详情"></p-navbar>
		<view class="fooler">
			<view>币种</view>
			<view style="color: #999999;">金额</view>
			<view style="color: #999999;">手续费</view>
			<view>时间</view>
		</view>
		<view class="fooler" v-for="(item,index) in countent" :key="index" @tap="router(item)">
			<view>{{cases(item.symbol)}}</view>
			<view>{{fixled(item.profit)}}</view>
			<view>-{{fixled(item.fee)}}</view>
			<view>{{str(item.createTime)}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				countent: [],
				pages: 1,
				form: {},
				data: true
			};
		},
		computed: {
			fixled() {
				return t => {
					if (!t || t == 'undefined') return '0.0000'
					return Number(t).toFixed(4)
				}
			},
			str() { //时间截取
				return t => {
					return t.substring(0, 10)
				}
			},
			cases() { //转大写
				return t => t.toUpperCase();
			},
		},
		watch: {
			show(val) {
				console.log(val)
				if (val == false) { //今日收益

				} else { //累计收益

				}
			}
		},
		onLoad() {
			this.request('order/profitRecordByDate?date=' + JSON.parse(this.$Route.query.type).createTime).then(res => {
				console.log(res.data.data)
				this.countent=res.data.data
			})

			// this.OrderList()
		},
		methods: {
			router(item) {
				// this.$Router.push({
				// 	path: '/pages/user/income-item',
				// 	query: {
				// 		type: JSON.stringify(item)
				// 	}
				// })
			},
		}
	}
</script>

<style lang="scss">
	.fooler {
		// width: ;
		margin: 0rpx 25rpx;
		line-height: 90rpx;
		border-bottom: 1rpx solid rgba(153, 153, 153, 0.2);
		display: flex;
		justify-content: space-between;
		align-items: center;

		view:nth-child(1) {
			width: 30%;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: bold;
			// line-height: 34px;
			color: #999999;
		}

		view:nth-child(2) {
			width: 30%;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: bold;
			line-height: 34px;
			color: $light-color;
		}

		view:nth-child(3) {
			width: 30%;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: bold;
			line-height: 34px;
			color: $light-color;
		}

		view:nth-child(4) {

			font-size: 28rpx;
			font-family: PingFang SC;
			// font-weight: bold;
			line-height: 34px;
			color: #999999;
			text-align: right;
			width: 30%;

		}
	}
</style>
